﻿namespace DataMorph.Web.Services
{
    using System.Collections.Generic;

    using DataMorph.Common;
    using DataMorph.Common.Contracts;
    using DataMorph.Common.DataAccess;
    using DataMorph.Common.Entities;
    using DataMorph.Generator;
    using DataMorph.Web.Models;

    public class DataMorphServiceMock : IDataMorphService
    {
        public string GenerateData(
                        string clientId, 
                        string storageAccountName, 
                        GenerationParameters generationParameters)
        {
            throw new System.NotImplementedException();
        }

        public string ProcessDataSet(string clientId, GenerationParameters parameters)
        {
            throw new System.NotImplementedException();
        }

        public void CancelTask(string taskId)
        {
            throw new System.NotImplementedException();
        }

        public IEnumerable<StorageAccountDetailsModel> GetStorageAccounts()
        {
            return new List<StorageAccountDetailsModel>
                       {
                           new StorageAccountDetailsModel { Name = "Name1", Key = "Key1" },
                           new StorageAccountDetailsModel { Name = "Name2", Key = "Key2" },
                           new StorageAccountDetailsModel { Name = "Name3", Key = "Key3" },
                           new StorageAccountDetailsModel { Name = "Name4", Key = "Key4" },
                       };
        }

        public IEnumerable<GenerationParametersModel> GetDataSets(string accountName)
        {
            var accountDict = new Dictionary<string, IEnumerable<GenerationParametersModel>>
            {
                {
                    "Name1",
                    new List<GenerationParametersModel>
                    {
                        new GenerationParametersModel { ClientId = "Set11", DataSetName = "set11" },
                        new GenerationParametersModel { ClientId = "Set12", DataSetName = "Set12" },
                        new GenerationParametersModel { ClientId = "Set13", DataSetName = "Set13" }
                    }
                },
                {
                    "Name2",
                    new List<GenerationParametersModel>
                    {
                        new GenerationParametersModel { ClientId = "Set21", DataSetName = "set21" },
                        new GenerationParametersModel { ClientId = "Set22", DataSetName = "Set22" },
                        new GenerationParametersModel { ClientId = "Set23", DataSetName = "Set23" }
                    }
                },
                {
                    "Name3",
                    new List<GenerationParametersModel>
                    {
                        new GenerationParametersModel { ClientId = "Set31", DataSetName = "set31" },
                        new GenerationParametersModel { ClientId = "Set32", DataSetName = "Set32" },
                        new GenerationParametersModel { ClientId = "Set33", DataSetName = "Set33" }
                    }
                },
                {
                    "Name4",
                    new List<GenerationParametersModel>
                    {
                        new GenerationParametersModel { ClientId = "Set41", DataSetName = "set41" },
                        new GenerationParametersModel { ClientId = "Set42", DataSetName = "Set42" },
                        new GenerationParametersModel { ClientId = "Set43", DataSetName = "Set43" }
                    }
                }
            };

            return accountDict.ContainsKey(accountName) ? accountDict[accountName] : new List<GenerationParametersModel>();
        }

        public IEnumerable<ProcessingRecord> GetProcessingInstances(string storageAccount)
        {
            throw new System.NotImplementedException();
        }
    }
}